home *** CD-ROM | disk | FTP | other *** search
/ Atari Forever 4 / Atari Forever 4 / Atari Forever 4.iso / SERIE_AI / AI_017 / INTERNET.TOS / SOFTWARE / TNFTPSR / TNDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-01  |  4.5 KB  |  154 lines

  1. /*     ANS compatible Telnet in AES windows     */
  2. /*         compiled with TURBO-C/PURE-C         */
  3. /*   P. Mayer & H. Wieser TU Vienna  6.3.1992   */
  4.  
  5. #ifndef NULL
  6. #define NULL ((char *) 0)
  7. #endif
  8.  
  9. #ifndef TRUE
  10. #define TRUE 1
  11. #define FALSE 0
  12. #endif
  13. #define SYSBASE ((SYSHDR*)0x4f2L)
  14. /* constants */
  15.  
  16. #define ALTINDICATOR '\05'
  17. #define MAXSCROLLED 8
  18. #define WOFFSET 10
  19. #define WI_WITHSLD (INFO|SIZER|UPARROW|DNARROW|VSLIDE|LFARROW|RTARROW|HSLIDE)
  20. #define WI_WITHTITLE (INFO|NAME|MOVER|CLOSER|FULLER)
  21. #define MAXCOL 132
  22. #define MAXROW 99
  23. #define MAXPARLEN     80
  24. #define MINMAX(x, y, z) ( x<y ? y : (x>z ? z :x) )
  25.  
  26. #define FM_INVERT 12            /* logic parameter to copy_fm */
  27. #define FM_COPY   3            /* copy source to dest */
  28. #define FM_CLEAR  0            /* zero dest */
  29.  
  30. #define X0 1            /* X border in bits around text in window */
  31. #define Y0 1            /* Y border in bits around text in window */
  32.  
  33. /* emulation FSM states */
  34.  
  35. #define ESC        0x1b
  36. #define RETURN        0x0d
  37. #define CAN            0x18
  38. #define ENQ        0x05
  39. #define SI        0x0f
  40. #define SO        0x0e
  41.  
  42. #define S_NORMAL    0
  43. #define S_ESC        1
  44. #define S_QUE        2
  45. #define S_CSI        4
  46. #define S_STATUS    5
  47. #define S_NOP        6
  48. #define S_NUM1        7
  49. #define S_NUM2        8
  50. #define S_CHS0        9
  51. #define S_CHS1        10
  52. #define S_ALIGN        11
  53.  
  54. #define min(a,b) ( a < b ? a : b )
  55. #define max(a,b) ( a > b ? a : b )
  56.  
  57. /* data types used */
  58.  
  59. typedef struct mfdb 
  60. {
  61.   short *ptr;            /* ptr to memory holding the image */
  62.   short wpix;            /* width in pixels */
  63.   short hpix;            /* height in pixels */
  64.   short wwords;            /* width in words */
  65.   short format;            /* 0 for machine-dependent */
  66.   short planes;            /* 1 for hires screen */
  67. } WIN_MFDB;
  68.  
  69. /*
  70.  * Fonts are all byte-wide, 16 bits high.  Not all of that is actually
  71.  * used, necessarily: when narrower, the less-significant bits are used.
  72.  * When shorter, the top rows are used.  The fonts from UW are 128 chars
  73.  * long, which is a lose for non-USAians.  The built-up system fonts
  74.  * are 256 chars long.
  75.  */
  76.  
  77. typedef struct fnt 
  78. {
  79.   int inc_x, inc_y;        /* real size of one char */
  80.   int nchars;            /* number of chars in this font */
  81.   char f_data[4096];        /* character data */
  82. } FNT;
  83.  
  84. typedef struct wi_str 
  85. {
  86.   struct wi_str *prev, *next;    /* list links */
  87.   int fd;            /* the pipe */
  88.   int pid;            /* the PID & PG of the process started here */
  89.   int aes_handle;        /* the AES hande number */
  90.  
  91.   unsigned int    sliders:1,        /* sliders? */
  92.           titles:1,        /* title bar? */
  93.           fulled:1,        /* fulled */
  94.           inverse:1,        /* inverse mode on */
  95.           insmode:1,        /* insert mode on */
  96.           curstate:1,        /* state of the cursor */
  97.         cursor_hidden:1,    /* cursor enabled?*/
  98.         discard:1,        /* wrap vs discard at last column */
  99.         curskey:1,
  100.         keypad:1,
  101.         origmode:1,
  102.             colwidth:1,
  103.             smooth:1,
  104.             repeat:1,
  105.             lfmode:1;
  106.   int fgbg[2];                /* text bg and fg (last arg to vrt_cpyfm) */
  107.   int slotno;                /* shrunk slot number in the dock */
  108.   int x, y, w, h;            /* work area on screen */
  109.   int save_x, save_y;            /* saved cursor location for ESC j/k */
  110.   int px, py, pw, ph;            /* previous location of entire window */
  111.   int x_off, y_off;            /* offset for visible part */
  112.   int px_off, py_off;            /* previous offset */
  113.   int m_off;                /* memory offset */
  114.   int wi_w, wi_h;            /* max w,h */
  115.   int cur_x, cur_y;            /* current cursor position */
  116.   int top_y;                /* position of top of circular window buffer */
  117.   int state;                /* state for the emulation FSM */
  118.   short vspos, vssiz;            /* pos & size of vertical slider */
  119.   short hspos, hssiz;            /* ditto horiz (saves unnec. redraws) */
  120.   FNT *font;                /* the font in use */
  121.   WIN_MFDB wi_mf;            /* memory form for this window */
  122.   char name[80];            /* name of this window */
  123.   char info[80];            /* info line of this window */
  124. /*  char nuname[80];*/            /* new name under construction */
  125. /*  int nuptr;*/            /* curr. len of new name */
  126.   int x_chrs, y_chrs;            /* size of terminal emulation */
  127.   int wi_style;                /* style of window (see WI_*SLD) */
  128.   int wi_mainstyle;            /* the style requested originally */
  129.   int topline, bottomline;        /* margins for scrolling region */
  130.   int markx1,marky1,markx2,marky2,lastx2,lasty2,direct;
  131.   int app;
  132.   int recv_flag;
  133.   int ftp_data;
  134.   unsigned char val1,val2,val[8],valcnt;
  135.   char G0,G1,chset;
  136. } WI_STR;
  137.  
  138. #define TN_SE        240
  139. #define TN_NOP        241
  140. #define TN_DM        242
  141. #define TN_BRK        243
  142. #define TN_IP        244
  143. #define TN_AO        245
  144. #define TN_AYT        246
  145. #define TN_EC        247
  146. #define TN_EL        248
  147. #define TN_GA        249
  148. #define TN_SB        250
  149. #define TN_WILL        251
  150. #define TN_WONT        252
  151. #define TN_DO        253
  152. #define TN_DONT        254
  153. #define TN_IAC        255 
  154.